<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改个人信息</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
            color: #333;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* 上层样式 - 顶部导航栏 */
        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 30px;
            background-color: #ffffff;
            box-shadow: 0 2px 15px rgba(0,0,0,0.1);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .back-btn {
            background-color: #4a6cf7;
            color: white;
            border: none;
            padding: 10px 25px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 4px 10px rgba(74, 108, 247, 0.25);
            transition: background-color 0.3s;
        }

        .back-btn:hover {
            background-color: #3a5ce0;
        }

        .page-title {
            font-size: 24px;
            font-weight: 700;
            color: #2c3e50;
            background: linear-gradient(to right, #6a11cb, #2575fc);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .user-display {
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 600;
            color: #4a6cf7;
            font-size: 18px;
            padding: 8px 15px;
            border-radius: 8px;
            background-color: #f0f7ff;
        }

        /* 内容区域样式 */
        .edit-container {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 40px 20px;
        }

        .edit-form {
            width: 100%;
            max-width: 700px;
            background-color: #ffffff;
            border-radius: 20px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.12);
            overflow: hidden;
        }

        .form-header {
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: white;
            padding: 25px 30px;
            text-align: center;
            font-size: 22px;
            font-weight: 600;
        }

        .form-body {
            padding: 40px;
        }

        .form-group {
            margin-bottom: 25px;
        }

        .form-label {
            display: block;
            margin-bottom: 10px;
            font-weight: 600;
            color: #2c3e50;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .form-label i {
            color: #6a11cb;
            font-size: 18px;
            width: 24px;
            text-align: center;
        }

        .form-input {
            width: 100%;
            padding: 16px 20px;
            border: 2px solid #e1e5eb;
            border-radius: 12px;
            font-size: 16px;
            transition: all 0.3s;
            background-color: #f9fbfd;
        }

        .form-input:focus {
            border-color: #4a6cf7;
            box-shadow: 0 5px 15px rgba(74, 108, 247, 0.2);
            outline: none;
            background-color: #ffffff;
        }

        .form-input[readonly] {
            background-color: #f0f4f8;
            color: #7a7e8c;
            cursor: not-allowed;
        }

        .button-group {
            display: flex;
            gap: 20px;
            margin-top: 30px;
        }

        .btn {
            flex: 1;
            padding: 18px;
            border: none;
            border-radius: 12px;
            font-size: 18px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
        }

        .btn-reset {
            background-color: #f0f4f8;
            color: #6c757d;
        }

        .btn-reset:hover {
            background-color: #e2e6ea;
            box-shadow: 0 5px 15px rgba(108, 117, 125, 0.2);
        }

        .btn-submit {
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: white;
            box-shadow: 0 5px 15px rgba(74, 108, 247, 0.35);
        }

        .btn-submit:hover {
            box-shadow: 0 8px 20px rgba(74, 108, 247, 0.45);
            background: linear-gradient(135deg, #5d0fc1 0%, #1c69f0 100%);
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            .top-bar {
                padding: 12px 15px;
            }

            .back-btn {
                padding: 8px 15px;
                font-size: 14px;
            }

            .page-title {
                font-size: 18px;
            }

            .user-display {
                font-size: 16px;
                padding: 6px 10px;
            }

            .form-body {
                padding: 25px 15px;
            }

            .button-group {
                flex-direction: column;
            }
        }

        /* 动画效果 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .edit-form {
            animation: fadeIn 0.6s ease-out;
        }
    </style>
</head>
<body>
<!-- 上层：顶部导航栏 -->
<div class="top-bar">
    <!-- 返回按钮 -->
    <button class="back-btn" onclick="location.href='/clients/clientuserspace'">
        <i class="fas fa-arrow-left"></i> 返回
    </button>

    <!-- 页面标题 -->
    <div class="page-title">修改个人信息</div>

    <!-- 用户名显示 -->
    <div class="user-display">
        <i class="fas fa-user"></i>
        <!-- 数据接口：后端需提供 user.username -->
        <span th:text="${user != null} ? ${user.username} : '访客'">用户名</span>
    </div>
</div>

<!-- 下层：编辑表单区域 -->
<div class="edit-container">
    <form class="edit-form" th:action="@{/clients/clientuserinfo}" method="post">
        <div class="form-header">
            <i class="fas fa-user-edit"></i> 编辑您的个人信息
        </div>

        <div class="form-body">
            <!-- 用户ID（不可编辑） -->
            <div class="form-group">
                <label class="form-label">
                    <i class="fas fa-id-card"></i>
                    用户ID
                </label>
                <input type="text" class="form-input"
                       th:value="${user != null} ? ${user.userId} : 'false'"
                       readonly>
            </div>
            <!-- 用户名 -->
            <div class="form-group">
                <label class="form-label">
                    <i class="fas fa-user"></i>
                    用户名
                </label>
                <input type="text" class="form-input" name="username"
                       placeholder="请输入用户名" required>
            </div>
            <!-- 手机号 -->
            <div class="form-group">
                <label class="form-label">
                    <i class="fas fa-mobile-alt"></i>
                    手机号
                </label>
                <input type="tel" class="form-input" name="phone"
                       placeholder="请输入手机号码" pattern="[0-9]{11}" required>
            </div>
            <!-- 邮箱 -->
            <div class="form-group">
                <label class="form-label">
                    <i class="fas fa-envelope"></i>
                    邮箱
                </label>
                <input type="email" class="form-input" name="email"
                       placeholder="请输入邮箱地址" required>
            </div>
            <!-- 按钮组 -->
            <div class="button-group">
                <!-- 重置按钮 -->
                <button type="reset" class="btn btn-reset">
                    <i class="fas fa-redo"></i> 重置
                </button>
                <!-- 提交按钮 -->
                <button type="submit" class="btn btn-submit">
                    <i class="fas fa-check-circle"></i> 确认更改
                </button>
            </div>
        </div>
    </form>
</div>
</body>
</html>